<!--
 * @Author: 刘海
 * @Date: 2023-12-09 09:44
-->

<template>
    <nav class="common-header flex-cb" id="top">
        <div class="logo-content flex-ac">
            <img class="logo" src="../../../assets//images/logo.png" />
            <span>上海律特科技有限公司</span>
        </div>
        <ul class="flex">
            <li class="item" v-for="item in headerItem">
                <span class="item-link" :href="item.href" @click="goto(item.href)">{{ item.title }}</span>
            </li>
        </ul>
    </nav>
</template>

<script setup>
import { useGoToElement } from '@/hooks/index.js';
const gotoElement = useGoToElement();
function goto(href) {
    gotoElement(href);
}
const headerItem = [
    {
        title: '业务范围',
        href: '#ywfw'
    },
    {
        title: '服务优势',
        href: '#fwys'
    },
    {
        title: '案例介绍',
        href: '#aljs'
    },
    {
        title: '联系我们',
        href: '#lxwm'
    },
]
</script>

<style scoped lang="scss">
.common-header {
    max-width: $pc-width;
    overflow: hidden;
    margin: 0 auto;
    padding: 0 100px;
    font-size: 20px;
    color: #fff;
    height: 74px;
    line-height: 74px;

    .logo {
        width: 35px;
        height: 33.5px;
        margin-right: 5px;
    }

    .item {
        margin-right: 55px;

        &:last-child {
            margin-right: 0;
        }

        .item-link {
            cursor: pointer;
            padding: 5px 10px;
            border-radius: 8px;
            transition: all .3s ease-out;
        }

        &:hover {
            .item-link {
                color: #080b38;
                background-color: #f5f5f5;
            }
        }
    }
}

@include respondTo(['notebook']) {
    .common-header {
        width: 100%;
        padding: 20px;
    }
}

@include respondTo(['phone', 'pad']) {
    .common-header {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: auto;
        line-height: initial;
        padding: 20px 0;

        .logo-content {
            margin-bottom: 20px;
        }

        .item {
            margin-right: 0;
            font-size: 16px;
        }
    }
}
</style>
